from google.appengine.ext import db
from google.appengine.tools import bulkloader
from DB.DB_Classes import *

uni = "TAU"
curr_year = "2012"
int_year = int(curr_year)
sem = ["A","B","SUMMER"]
faculties = ["Exact"]
hug_map = {"Exact" : ("CS",)}

class DBLoader:
    def db_loader(self):
        uni = University.get_or_insert(key_name = uni ,uni_name = uni)
        year = Year.get_or_insert(key_name = curr_year, year_number = int_year, parent = uni)
        for elem_sem in sem:
            semester = Semester.get_or_insert(key_name = elem_sem ,semester_name = elem_sem, parent = year)
            for elem_facu in faculties:
                facu = Faculty.get_or_insert(key_name = elem_facu,faculty_name = elem_facu, parent = semester)
                
                for elem_hug in hug_map.get(elem_facu):
                    hug = Hug.get_or_insert(key_name = elem_hug, hug_name=elem_hug, parent = facu)
                
        
    
    
    
    